﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PageModel>" %>
<%@ Import Namespace="MVCStore.Views.Page"%>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    
    <%if( Model.ParentNodeId != -1 ){ %>
		<%=Html.ActionLink("Up to parent", "PageContent", "Page", new { pageId = Model.ParentNodeId }, null)%>
    <%}%>
    
    <h2><%=Model.PageTitle%></h2>
    <%=Model.PageContent%>
    
    <%if( Model.Children.Count > 0 ){ %>
    
		<h3>Table of Contents</h3>
		<ul>
			<%foreach( KeyValuePair<int, string> toc in Model.Children ){ %>
			<li><%=Html.ActionLink(toc.Value, "PageContent", "Page", new { pageId = toc.Key }, null)%></li>
			<%}%>
		</ul>
    <%}%>

</asp:Content>
